package com.qf.osmorder.order.task;

import com.qf.osmorder.order.service.OrderService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author TianWenHe
 * @date 2025/6/13
 * @desc
 */
@Component
public class RechargeOrderCheckJob {

    @Autowired
    private OrderService orderService;

    /**
     * 每5秒执行一次，检查未完成的充值订单（status=1）
     */
    @XxlJob("checkRechargeOrderStatusJob")
    public void checkRechargeOrderStatusJob() {
        orderService.checkRechargeOrders();
    }
}
